def average():
    li = []  # 自由变量

    def inner(value):
        li.append(value)
        return sum(li) / len(li)

    return inner


avg = average()
print(avg(6000))
print(avg(7000))
print(avg(8000))
"""
输出:
6000.0
6500.0
7000.0
"""
